//
//  UIViewController+HDBtnDemoVC.m
//  app
//
//  Created by apple on 2017/7/23.
//  Copyright © 2017年 hdaren. All rights reserved.
//

#import "HDBtnDemoVC.h"

@implementation  HDBtnDemoVC

-(void)viewDidLoad
{
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
     CGFloat imageWidth = (UBO_SCREEN.width-12*5)/4;
    /*
    UIButton * btn1 = [[UIButton alloc]initWithFrame:CGRectOf([self.view.ubo fx:0 ox:12 fy:0 oy:12+64], [self.view.ubo ow:imageWidth oh:imageWidth])];
    btn1.backgroundColor = [UIColor blueColor];
    [btn1 addTarget:self action:@selector(de:) forControlEvents:UIControlEventTouchUpInside];
    btn1.tag = 1;
    [self.view addSubview:btn1];
    
    UIButton * btn2 = [[UIButton alloc]initWithFrame:CGRectOf([self.view.ubo fx:0 ox:12*2+imageWidth fy:0 oy:12+64], [self.view.ubo ow:imageWidth oh:imageWidth])];
    btn2.backgroundColor = [UIColor blueColor];
    [btn2 addTarget:self action:@selector(de:) forControlEvents:UIControlEventTouchUpInside];
    btn2.tag = 2;
    [self.view addSubview:btn2];
    
    UIButton * btn3 = [[UIButton alloc]initWithFrame:CGRectOf([self.view.ubo fx:0 ox:12*3+imageWidth*2 fy:0 oy:12+64], [self.view.ubo ow:imageWidth oh:imageWidth])];
    btn3.backgroundColor = [UIColor blueColor];
    [btn3 addTarget:self action:@selector(de:) forControlEvents:UIControlEventTouchUpInside];
    btn3.tag = 3;
    [self.view addSubview:btn3];
    */
    
    
    
    for ( int i = 0; i < 4; i++) {
        
        
        
        UIButton * btn = [[UIButton alloc]initWithFrame:CGRectOf([self.view.ubo fx:0 ox:(2*(i+1)+i*imageWidth) fy:0 oy:64], [self.view.ubo ow:imageWidth oh:imageWidth])];
        
        //        btn.frame = iv.bounds;
        btn.backgroundColor = [UIColor blueColor];
        [btn addTarget:self action:@selector(dadade:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:btn];
        
       
        
    }
    

}


-(void)de:(UIButton*)sender
{
    DLog(@"clickclickclickclickclick");

}

-(void)dadade:(UIButton*)sender
{
    DLog(@"hahahhahahahahaha");
}

@end
